import { UserOrder } from '@/types/finance';
import axios from 'axios';
import { AnyObject, HttpResponse, PageResponse } from '@/types/global';
import { API_V1_URL } from '@/config/api';

export function getOrderList(data: AnyObject) {
  return axios.post<HttpResponse<PageResponse<UserOrder>>>(
    `${API_V1_URL}/wechat/order/page`,
    data
  );
}

export function exportOrder(data: AnyObject) {
  return axios.post<HttpResponse<string>>(
    `${API_V1_URL}/wechat/order/export`,
    data
  );
}

export function startRefund(orderNumber: string) {
  return axios.post(
    `${API_V1_URL}/wechat/order/manual/refund?orderNumber=${orderNumber}`
  );
}
